package main

import "fmt"

// 类型断言
func main() {
	assign(100)
}

func assign(a interface{}) {
	s, ok := a.(string)
	switch a.(type) {
	case int:
		fmt.Println("这是int")
	case string:
		fmt.Println("这是string")
	}
	fmt.Println(ok)
	fmt.Println(s)
}
